package flc.ast.fragment;

import android.Manifest;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.blankj.utilcode.util.ToastUtils;

import flc.ast.R;
import flc.ast.activity.SelPicActivity;
import flc.ast.databinding.FragmentToolBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;
import stark.common.basic.utils.ResUtil;
import stark.common.basic.utils.StkPermissionHelper;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.ivFilter.setOnClickListener(this);
        mDataBinding.ivDoodle.setOnClickListener(this);
        mDataBinding.ivSticker.setOnClickListener(this);
        mDataBinding.ivPuzzle.setOnClickListener(this);
        mDataBinding.ivBackground.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        int id = v.getId();
        if (id == R.id.ivFilter) {//滤镜
            SelPicActivity.type = 0;
            startActivity(SelPicActivity.class);
        } else if (id == R.id.ivDoodle) {
            SelPicActivity.type = 1;
            startActivity(SelPicActivity.class);
        } else if (id == R.id.ivSticker) {
            SelPicActivity.type = 2;
            startActivity(SelPicActivity.class);
        } else if (id == R.id.ivPuzzle) {
            SelPicActivity.type = 3;
            startActivity(SelPicActivity.class);
        } else if (id == R.id.ivBackground) {
            SelPicActivity.type = 4;
            startActivity(SelPicActivity.class);
        }
    }

    @Override
    protected void initData() {

    }
}